# -*- coding: utf-8 -*-
"""
创建日期: 2024/9/17   16:03

@author: justinc
@blog: https://blog.csdn.net/sjc122333?type=blog
@gitee: https://gitee.com/justinc666

"""
# 常规写法1
list_1 = []

for i in range(1, 10):
    list_1.append(i)

print(list_1)
# 常规写法2
list_2 = []
for i in range(1, 10):
    list_2.append(i*i)

print(list_2)

# 列表推导式1
list_1 = [x for x in range(1, 10)]
print(list_1)

# 列表推导式2
list_2 = [i*i for i in range(1, 10)]
print(list_2)






